package com.cskaoyan._05oop2._07static._01Student;

/**
 * @author Macro_Ray
 * @since 2024/3/9 9:16
 */
// static简单练习
    // 需求：javabean类来描述这个班级的学生
    // 属性：姓名、年龄、性别
    // 行为：学习
    // 新增老师属性
public class Student {
    // 属性：姓名 年龄 性别
    private String name;
    private int age;
    private String gender;
    public static String teacherName; // 新增静态成员变量

    public Student() {
    }

    public Student(String name, int age, String gender) {
        this.name = name;
        this.age = age;
        this.gender = gender;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    // 行为
    public void study() {
        System.out.println(name + "正在学习");
    }

    // 打印属性
    public void show(){
        System.out.println("name = " + name);
        System.out.println("age = " + age);
        System.out.println("gender = " + gender);
        System.out.println("teacherName = " + teacherName);
    }
}

